<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%response.setHeader("Pragma","No-cache");
	response.setHeader("Cache-Control","no-cache");
	response.setDateHeader("Expires", 0);
	response.flushBuffer();%>
<html>
<head>
	<meta charset="utf-8">
	<meta name="decorator" content="default"/>
	<meta http-equiv="Cache-Control" content="max-age=7200" />
	<meta name="format-detection" content="telephone=yes">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=no">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<link rel="icon" href="https://static.jianshukeji.com/highcharts/images/favicon.ico">
	<style type="text/css">
		#container {
			height: 90vh;
			margin: 0 auto;
		}
	</style>
	<script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
	<script src="https://img.hcharts.cn/highcharts/modules/exporting.js"></script>
	<script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
	<script type="text/javascript" src="${ctxStatic}/ajz/js/jquery.min.js"></script>
</head>
<body>
<div id="searchForm" class="breadcrumb form-search">
	<label>日期范围：&nbsp;</label><input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
									 value="<fmt:formatDate value="${log.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
	<label>&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
																value="<fmt:formatDate value="${log.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>&nbsp;&nbsp;
	&nbsp;&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="search();"/>&nbsp;&nbsp;
</div>
<div id="container" style="min-width:400px;height:500px"></div>
<script>
     $(document).ready(function() {
            search();
     	});
    function search() {
        var msg = 'person';
        var beginDate = $("#beginDate").val();
        var endDate = $("#endDate").val();
        $.ajax({
            url: "/a/ajz/ajzBaseinfo/findCheckNumByUser",
            type: "POST",
            data: "msg="+msg+"&beginDate="+beginDate+"&endDate="+endDate,
            dataType: "json",
            async: true,
            success: function (map) {

                var heSonshang = parseInt(map.person_he);
                var liuShouxing = parseInt(map.person_liu);
                var zhangjun= parseInt(map.person_zhang);
                var zhangshidi = parseInt(map.person_shi);
                var xuzhenghui = parseInt(map.person_xu);
                var liquan = parseInt(map.person_li);
                var lili = parseInt(map.person_lili);
                var linzhixiong = parseInt(map.person_lin);
                var xieyi = parseInt(map.person_xieyi);
                var huangzhiwei = parseInt(map.person_huang);
                getDate(heSonshang,liuShouxing,zhangjun,zhangshidi,xuzhenghui,liquan,lili,linzhixiong,xieyi,huangzhiwei);
            }
        });
    };
	function getDate(a,b,c,d,e,f,g,h,i,j) {
        var chart = Highcharts.chart('container', {
            chart: {
                type: 'column'
            },
            title: {
                text: '个人检查数量统计'
            },
            subtitle: {
                text: '来源: 新阳安监站'
            },
            xAxis: {
                type: 'category',
                labels: {
                    rotation: -45  // 设置轴标签旋转角度
                }
            },
            yAxis: {
                min: 0,
                title: {
                    text: '检查次数'
                }
            },
            legend: {
                enabled: false
            },
            tooltip: {
                pointFormat: '检查总次数: <b>{point.y:.1f} 次</b>'
            },
            series: [{
                name: '人数',
                data: [
                    ['黄彪华', a],
                    ['刘寿兴', b],
                    ['张军', c],
                    ['黄志伟', j]
                ],
                dataLabels: {
                    enabled: true,
                    rotation: -90,
                    color: '#FFFFFF',
                    align: 'right',
                    format: '{point.y:.1f}', // :.1f 为保留 1 位小数
                    y: 10
                }
            }]
        });
    }
</script>
</body>
</html>
